import os
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
#编辑路径打开页面
driver = webdriver.Chrome()
file = "file:///"+os.path.abspath("../html/radio-checkbox.html")
driver.get(file)

boy = driver.find_element(By.ID, "boy")
boy.click()
print(boy.is_selected())

girl = driver.find_element(By.ID, "girl")
print(girl.is_selected())
girl.click()
print(girl.is_selected())

time.sleep(2)
driver.quit()